package demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@EnableAutoConfiguration
@EnableJpaRepositories(basePackages = "demo.dao")
@ComponentScan(basePackages = { "demo.service", "demo.controller", "demo.domain" }, excludeFilters = @Filter(Configuration.class))
@EnableCaching
@Import({ CachingConfig.class })
public class Application {

    public static void main(final String[] args) {
        SpringApplication.run(Application.class, args);
    }

    // @Bean
    // public org.springframework.cache.CacheManager cacheManager() {
    // return new EhCacheCacheManager(ehCacheManagerFactoryBean());
    // }
    //
    // @Bean
    // public CacheManager ehCacheManagerFactoryBean() {
    // final EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new
    // EhCacheManagerFactoryBean();
    // ehCacheManagerFactoryBean.setConfigLocation(new
    // ClassPathResource("ehcache.xml"));
    // return ehCacheManagerFactoryBean.getObject();
    // }

}
